home *** CD-ROM | disk | FTP | other *** search
- Path: news.db.erau.edu!marseed
- From: marseed@news.db.erau.edu (Darryl E. Marsee)
- Newsgroups: comp.lang.c
- Subject: HELP - why isn't ld working
- Date: 2 Feb 1996 15:28:07 GMT
- Organization: Embry-Riddle Aeronautical University
- Message-ID: <4etai7$22s@deadbird.db.erau.edu>
- NNTP-Posting-Host: 155.31.1.1
- NNTP-Posting-User: marseed
- X-Newsreader: TIN [version 1.2 PL2]
-
- Greetings. Got a user with the following problem:
-
- He has two source files, called ex5.c:
-
- #include <stdio.h>
- float input(void);
- main()
- {
- printf("The value entered equals: %f\n", input());
- }
-
- and ex5a.c:
-
- float input(void)
- {
- float flop;
- printf("Enter a floating point number: ");
- scanf("%f", &flop);
- return flop;
- }
-
- Under Solaris 2.4, SunOS 4.1.4, and AIX 4.1.3 if he does the following:
-
- gcc ex5.c ex5a.c
-
- It produces a correctly executing a.out. So far so good.
-
- Again under all three operating systems, if he does the following instead:
-
- gcc -c ex5.c
- gcc -c ex5a.c
-
- Everything compiles fine. However, if he then tries to link them to
- produce an executable with the following:
-
- ld ex5.o ex5a.o -lc
-
- On Solaris 2.4 it produces a working a.out, but on SunOS 4.1.4 it produces
- an a.out that core dumps with a segmentation fault, and on AIX 4.1.3 it
- produces nothing but gives the error message
-
- ld: 0711-327 WARNING: Entry point not found: __start
- ld: 0711-244 ERROR: No csects or exported symbols have been saved.
-
- I'm not a C programmer, so I don't have much of a clue what's going on here.
- Does anyone have any idea why the ld command he used works under Solaris 2.4
- but not under SunOS 4.1.4 or AIX 4.1.3?
-
- Thanks,
-
- Darryl Marsee Unix Systems Administrator
- marseed@db.erau.edu Computer Science Department
- http://erau.db.erau.edu/~marseed Embry-Riddle Aeronautical University
- (904) 226-7081 Daytona Beach, Florida
-